'use strict';
// 获取数据库的引用
const db = uniCloud.database()
exports.main = async (event, context) => {
	// 获取表的集合
	const collection = db.collection('user')
	//event为客户端上传的参数
	const { username, password } = event
	const res = await collection.add({name: username, password})
	
	//返回数据给客户端
	return {
		code: 0,
		msg: res
	}
};
